package com.itmuch.cloud.service;

import com.itmuch.cloud.config.FeignLogConfiguration;
import com.itmuch.cloud.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author Aaron
 * @since 2020/12/25 16:15
 * <p>描述：Feign 的 fallback 测试
 * 使用 @FeignClient 的 fallback 属性指定回退类 </p>
 */
@FeignClient(name = "microservice-provider-user",
        configuration = FeignLogConfiguration.class,
        fallback = FeignClientFallback.class)
public interface UserFeignClient {

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    User findById(@PathVariable("id") Long id);

}
